// 使用组合式api的写法（setup函数）
export const useMusicStore = defineStore('musics', () => {

    const musicList = reactive([
        {
            id:"01001",
            name:"你是我的情人"
        },
        {
            id:"01002",
            name:"你是我的眼"
        },
        {
            id:"02001",
            name:"你是我的宝贝"
        }
    ]);

   
    function addMusic(newMusic) {

        musicList.push(newMusic)

    }
    
    return { 
        musicList, 
        addMusic
     }
  })